package com.uml.umlwork.utils;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

public class DataUtil {

    public static void pageFormat(Page source, PageResult target){
        target.setCurrent(source.getCurrent())
                .setSize(source.getSize())
                .setTotalCount(source.getTotal())
                .setTotalPage(source.getTotal() % source.getSize() == 0 ? source.getTotal() / source.getSize() : source.getTotal() / source.getSize() + 1)
                .setData(source.getRecords());
    }

    public static Boolean notNull(Object object){
        return object != null;
    }

}
